Loading...
 

CX_STRING - Text

CX_STRING

Class hierarchy
Description:

This class is used to display a text of any length. Objects of this class can be created by CreateTransObject(CX_STRING) or CreatePersObject(CX_STRING) . The content is assigned by put. The STRING contained in can be accessed via String.

199051
If an attempt is made to call a method via Call() on a STRING/ML_STRING, then this string is implicitly converted into a temporary CX_STRING object for the Call() , so that all methods mentioned here can be called directly on regular STRINGsand ML_STRINGs(active language). Methods that change the CX_STRING (example: FromBytes) have no effect, because they only work on a temporary copy of the STRING.

Code example:
Var(logFilePattern) "^.*\.log$" -> logFilePattern logFilePattern "test.log" Call(Matches) // -> TRUE logFilePattern "test.txt" Call(Matches) // -> FALSE "Aa0" Call(GetBytes) // -> [ 65 97 48 ] // To load the ascii bytes into a string we need an actual object Var(str) CreateTransObject(CX_STRING) -> str Revert str Call(FromBytes) str // -> CX_STRING(Aa0) String // -> "Aa0" "test" str Put str // -> CX_STRING(test)

List of methods (MDI)
Function MA* Parameters Return Brief description
BitPattern CX_BIT_PATTERN replaces the CX_BIT_PATTERN constant
ConvertFromUTF8 Converts the contents of the CX_STRING from UTF-8 to the system code page
ConvertToUTF8 Converts the contents of CX_STRING from the system code page to UTF-8
Date OBJECT replaces the CX_DATE constant
DLDistance
174605
STRING INTEGER calculates the Damerau-Levinshtein distance to the given string
DoubleMetaphone
174605
STRING calculates the double metaphone phonetics of this string
FromBytes VECTOR creates a string from the bytes passed
GetBitPattern
225959
CX_BIT_PATTERNAlias for BitPattern method
GetBytes VECTOR returns the byte representation of the string
GetCharType
176006
INTEGERINTEGER Returns the type of the alphabet of the referenced character
Matches STRING INTEGER Fits on regular expression?
NormalisedDLDistance
231171
STRINGCX_FLOATDLDistance normalised to the value range (0...1)
Repeat
201607
INTEGER STRING Repeats the string n times
Replace
203259
VECTOR〈STRING〉, VECTOR〈STRING〉 STRING Replaces strings within the string
ReplaceRegex
222174
VECTOR〈STRING〉, VECTOR〈STRING〉STRINGReplaces regular expressions within the string
SpanDate OBJECT replaces the CX_SPAN_DATE constant
string INTEGER CX_STRING Returns the string representation of the object

* MA = Member Access Function

This class has no data fields.

Use in AppsWH
Module Brief description